<!DOCTYPE html><html><head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>   
	<title>填写信息</title>
    <style type="text/css">
        * {
            outline: none;
            -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
            vertical-align: baseline;
            font-style: normal;
        }

        body {
            margin: 0;
            padding: 0;
            font-size: 12px;
            font-family: Microsoft Yahei, Arial, Simsun, Helvetica, Segoe UI, sans-serif;
            color: #404040;
            background-color: #efeff4;
        }

        img {
            border: 0
        }

        ul, ol, li, dt, dl, dd {
            text-decoration: none;
            list-style: none;
            vertical-align: middle;
            margin: 0;
            padding: 0;
        }

        a,
        a:visited {
            color: #373737;
            text-decoration: none;
        }

        .blank {
            width: 100%;
            height: 20px;
        }
 #getCode {color:#777;margin-right:10px;padding-left:10px;padding-right:10px;text-align:right;margin-top:8px;background:#fff;float:right;cursor:pointer;}        .submit {
            width: 94%;
            margin: 0 3%;
            border: none;
            background: #08BA06;
            border-radius: 4px;
            height: 40px;
            line-height: 40px;
            font-size: 18px;
            color: #FFF;
            margin-top: 40px;
            outline: none
        }
		.unsubmit {
            width: 94%;
            margin: 0 3%;
            border: none;
            background: #bbb;
            border-radius: 4px;
            height: 40px;
            line-height: 40px;
            font-size: 18px;
            color: #FFF;
            margin-top: 40px;
            outline: none
        }


        
</style>
</head>

<body>
    <style type="text/css">
        .blank {
            width: 100%;
            height: 20px;
        }

        .userinfoMain {
            width: 100%;
            background-color: #FFF;
            display: table;
        }

        .userinfoMain .userinfoItem {
            width: 96%;
            margin-left: 4%;
            height: 50px;
            line-height: 50px;
        }

  .userinfoMain .userinfoItem span {
            float: left;
            display: block;
            width: 60px;
            height: 50px;
            line-height: 50px;
            text-align: left;
            font-size: 14px;
        }

        .userinfoMain .userinfoItem {
            border-bottom: 1px solid #dbdbdb;
        }

        .userinfoMain .userinfoItem:last-child {
            border-bottom: none;
        }

        .userinfoMain .userinfoItem input {
            width: 100px;
            height: 30px;
            border: none;
            font-size: 14px;
        }

        button {
            width: 94%;
            margin: 0 3%;
            border: none;
            background: #08BA06;
            border-radius: 4px;
            height: 40px;
            line-height: 40px;
            font-size: 18px;
            color: #FFF;
            margin-top: 40px;
            outline: none
        }
    </style>

    <script type="text/javascript">

    
        $(function () {
        	function checkTel(tel)
        	{
        	   var mobile = /^1[3|5|7|8]\d{9}$/ , phone = /^0\d{2,3}-?\d{7,8}$/;
        	   return mobile.test(tel) || phone.test(tel);
        	}


        	
			$('.getCode').click(function(){

                var mobile = $('input[name="mobile"]').val();
                if (mobile == "") {
                    $('#msg').html("请正确填写您的手机号！");
                    return false;
                }

				if(!checkTel(mobile)){
                    $('#msg').html("请填写您的正确手机号！");
                    return false;
				}
				
				$.ajax({
					type:'get',
					url:'index.php?act=index&op=getauthcode',
					data:{mobile:mobile},
					dataType:'json',
					success:function(data){	
						if(data.state == '0'){
		                    $('#msg').html(data.error);
		                    return false;
						}else{
				        	var countdown=60; 
				        	function settime() { 
				        	    if (countdown == 0) { 
				        	    	$('#getCode').addClass('getCode');
				        	    	$('#getCode').val("获取验证码");
				        	        countdown = 60; 
				        	        return;
				        	    } else { 
				        	    	$('#getCode').removeClass('getCode');
				        	    	$('#getCode').val("重新发送(" + countdown + ")");
				        	        countdown--; 
				        	    } 
				        	setTimeout(function() { 
				        	    settime('#getCode') }
				        	    ,1000) 
				        	}

				        	settime();
						}			
					}
				});
				
			});


            
            $(".submit").on("click", function() {
                var mobile = $('input[name="mobile"]').val();
                if (mobile == "") {
                    $('#msg').html("请正确填写您的手机号！");
                    return false;
                }

				if(!checkTel(mobile)){
                    $('#msg').html("请填写您的正确手机号！");
                    return false;
				}

				var authcode = $('input[name="authcode"]').val(); 
                if (authcode == "") {
                    $('#msg').html("验证码不能为空");
                    return false;
                }
                
				var auction_id = '<?php echo $output['auction_id']?>';
				$.ajax({
					type:'post',
					url:'index.php?act=index&op=mobile',
					data:{mobile:mobile,authcode:authcode},
					dataType:'json',
					success:function(data){
						if(data.state=='1'){
							if(auction_id!=''){
								location.href = 'index.php?act=index&auction_id='+auction_id;
							}else{
								location.href = 'index.php?act=index';
							}
							return false;
						}else{
			                $('#msg').html("验证码错误");
			                return false;
						}
					}
				});
            });
        });
    </script>

    <div id="contentbox" style="min-height: 576px;">
        <div class="blank"></div>

        <div class="userinfoMain">
            <div class="userinfoItem">
                <span>手机号</span>
                <input name="mobile" type="text" placeholder="填写您的手机号">
                <input id="getCode" class="getCode" type="button" value="获取验证码">
            </div>
            <div class="userinfoItem">
                <span>验证码</span>
                <input name="authcode" type="text" placeholder="输入验证码">
            </div>
            <div class="userinfoItem">
				<font style="color:red" id="msg"></font>
            </div>
        </div>
        <button class="submit">确 认</button>
    </div>
</body>
</html>